<?php
include_once("inc/conn.php");
include_once("inc/function.php");
include_once("heheadmin/inc/config.php");
$tj=intval($_GET['tj']);
/* wk  修改推荐人 */
if($tj)setcookie('tj',$tj);

if(isset($_SESSION['usersid'])) {
    echo ChangeEncodeU2G("<script >alert('你已经登录成功，你可以退出后再注册!');location.href = '/';</script>");
    exit;
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>保时捷28,蛋蛋28,加拿大28,幸运28,PC蛋蛋,<?php echo $web_name ;?></title>
<?php 
    require 'public/title.inc_yj.php';
?>
<link rel="stylesheet" type="text/css" href="style/yj_index.css" />
<script type="text/javascript" src="js/login.js"></script>
<script type="text/javascript" src="js/reg.js"></script>
</head>
<body>
<?php 
    require 'top2.php';
?>
<div class="register-section" style="display: block;">
        <div class="mc-section clearfix">
            <div class="childModal fr">
                <div class="title"><span class="fl">免费注册</span><span class="fr tips">已有账号？<a href="login.php">直接登录</a></span></div>
                    <div class="iptRow clearfix">
                        <div class="left fl">账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</div>
                        <div class="right fl">
                            <input type="text" placeholder="请输入手机号" name="userName" id="yj_username">
                        </div>
                    </div>
                    <div class="iptRow clearfix">
                        <div class="left fl">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</div>
                        <div class="right fl">
                            <input type="password" placeholder="请输入密码" name="loginPwd" id="yj_pass">
                        </div>
                    </div>
                    <div class="iptRow clearfix">
                        <div class="left fl">昵&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：</div>
                        <div class="right fl">
                            <input type="text" placeholder="昵称" name="nickName" id="yj_nickname">
                        </div>
                    </div>
                    <div class="iptRow clearfix">
                        <div class="left fl">推荐人ID：</div>
                        <div class="right fl">
                            <input type="text" placeholder="没有可以不填写" name="referrer" id="yj_tjid" placeholder="没有可不填写" value="<?php echo $_COOKIE['tj'];?>" <?php if($_COOKIE['tj']) echo 'readonly';?>>
                        </div>
                    </div>
                    <div class="iptRow clearfix">
                        <div class="left fl">验&nbsp;&nbsp;证&nbsp;&nbsp;码：</div>
                        <div class="right fl">
                            <input type="text" class="v-codeIpt" placeholder="验证码" name="captcha" id="yj_svcode">
                            <div class="v-codeImg"><img src="vcode.php" alt=""onclick="this.src='vcode.php?tm=' + Math.random();" style="cursor:pointer;"/></div>
                        </div>
                    </div>
                    <div class="iptRow clearfix">
                        <div class="left fl">短信验证：</div>
                        <div class="right fl">
                            <input type="text" class="v-codeIpt" placeholder="短信验证码" name="phoneCaptcha" id="yj_vcode">
                            <div class="phoneV-code"><a href="javcscrip:;" id="yj_getcode" style="color: black;">发送验证码</a></div>
                        </div>
                    </div>
                    <div class="agreement">
                        <input type="checkbox" name="agreement" id="cbxSee">
                        <a href="/agreement.php" style="color: black;">同意注册协议</a>
                    </div>
                    <div class="child-btn nocan-btn" id="yj_reg"> 立即注册</div>
            </div>
        </div>
    </div>
<script language="javascript" type="text/javascript">
    var times=60,cuttime;
    function getyzm(idn){
        times--;
        if(times>0&&times<60){
            $(idn).text(times+"秒后重新获取");
            $(idn).removeClass("btn-danger");
            cuttime=setTimeout(function(){getyzm(idn)},1000);
        }
        else{
            $(idn).text("获取短信验证码");
            times=60;
            $(idn).addClass("btn-danger");
            clearTimeout(cuttime);
        }
    }

    $(function(){
        $("#dl-tab li").bind({
            click:function(){
                $("#dl-tab li").removeClass("current");
                $(this).addClass("current");
                $("#login-box .login-form").hide();
                $("#login-box .login-form").eq($(this).index()).show();
                $(".yzm img").eq($(this).index()).attr("src","captcha.php?1337027384");
            }
        });

        $("#yj_getcode").bind("click",function(){
            //getyzm("#getcode");
            var captcha=$("#yj_svcode").val();
            if(captcha.length!=4){
                alerts("请输入验证码");
                return false;
            }
            var mobile=$("#yj_username").val();
            var re = /^1\d{10}$/
            if (!re.test(mobile)) {
                alerts("请输入手机号码");
                return false;
            }
            if(times==60){

                $.post('sms.php', {mobile: mobile,code:captcha}, function(data){
                    if(data.code>0){
                        alerts(data.data);
                    }else{
                        alerts("发送成功,请查看!");
                        getyzm("#yj_getcode");
                    }
                    $("#yj_verify").trigger("click");
                }, 'json');
            }
            return false;
        });

    });
    function alerts(msg) {
        alert(msg);
    }
</script>

 <script type="text/javascript" charset=utf-8>
 document.getElementById('login') = function check(event){ 
           var password = document.getElementById("yj_pass").value; 
           var repsword = document.getElementById("yj_repass").value; 
       if(password != repsword) {
        alert("两次密码不同，请重新输入");
          if (event.preventDefault) {
               event.preventDefault();
           } else {
               event.returnValue = false;
           }
        } else {
           return true;
        }
  }
</script>   
    
    
<? require 'yj_footer.php';?>
</body>
</html>
